package com.JavaBasic;

public class MathDemo {
	public static void main(String[] args) {
		System.out.println("PI=" + Math.PI);
		System.out.println("-10取绝对值:" + Math.abs(-10));
		System.out.println("12.33向上取整:" + Math.ceil(12.33));
		System.out.println("12.33向下取整:" + Math.floor(12.33));
		System.out.println("5和8取最大值:" + Math.max(5, 8));
		System.out.println("5和8取最小值:" + Math.min(5, 8));
		System.out.println("2的3次方:" + Math.pow(2, 3));
		System.out.println("获取0-1的一个随机数:" + Math.random());
		System.out.println("12.33四舍五入:" + Math.round(12.33));
		System.out.println("12.66四舍五入:" + Math.round(12.66));
		System.out.println("9开方:" + Math.sqrt(9));
	}
}
